package com.user.controller;

import com.user.entity.User;
import com.user.service.UserService;
import com.user.util.CommonResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;
    @PostMapping("/login")
    public CommonResponse login(@RequestBody User user){
        return userService.login(user);
    }
    @PostMapping("/register")
    public CommonResponse register(@RequestBody User user){
        return userService.register(user);
    }
}
